<!DOCTYPE html>
<%@ include file="common.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
<meta charset="UTF-8">
<title>后台首页</title>
<script type="text/javascript">
	if (sessionStorage.user != "admin") {
		location.href = "./login.jsp";
	}
</script>
<link rel="stylesheet" type="text/css" href="../css/jquery-accordion-menu.css">
<style type="text/css">
.content {
	width: 260px;
	margin: 100px auto;
}

.filterinput {
	background-color: rgba(249, 244, 244, 0);
	border-radius: 15px;
	width: 90%;
	height: 30px;
	border: thin solid #FFF;
	text-indent: 0.5em;
	font-weight: bold;
	color: #FFF;
	margin-top: 10px;
	padding: 0 10px;
}

#menu-list a {
	overflow: hidden;
	text-overflow: ellipsis;
	-o-text-overflow: ellipsis;
	white-space: nowrap;
	width: 100%;
}

.iframe {
	width: 915px;
	float: right;
}

.iframe iframe {
	width: 100%;
	border: none;
	min-height: 800px;
}
</style>
</head>
<body>
	<header>
		<div class="container" style="height: 100px; border: 1px solid red;"></div>
	</header>
	<div class="container">
		<div id="jquery-accordion-menu" class="jquery-accordion-menu blue">
			<div class="jquery-accordion-menu-header" id="form"></div>
			<ul id="menu-list">
				<li id="mcm">
					<a href="javascript:void(0)" onclick="go('mcm')"><i class="fa fa-home"></i>会员卡管理</a>
				</li>
				<li id="pcm">
					<a href="javascript:void(0)" onclick="go('pcm')"><i class="fa fa-home"></i>充值卡管理</a>
				</li>
				<li id="bm">
					<a href="javascript:void(0)" onclick="go('bm')"><i class="fa fa-home"></i>余额管理</a>
				</li>
				<li id="im">
					<a href="javascript:void(0)" onclick="go('im')"><i class="fa fa-home"></i>积分管理</a>
				</li>
			</ul>
		</div>
		<div class="iframe">
			<iframe id="iframe" src="function/mcm.jsp" onload="iFrameHeight()"></iframe>
		</div>
	</div>

</body>
<script type="text/javascript" src="../js/jquery-accordion-menu.js"></script>
<script type="text/javascript" src="../js/jquery-accordion-menu-search.js"></script>
<script type="text/javascript">

	$(function() {
		// 控件初始化
		$("#jquery-accordion-menu").jqueryAccordionMenu();
		// 列表项背景颜色切换
		$("#menu-list li").click(function() {
			$("#menu-list li.active").removeClass("active")
			$(this).addClass("active");
		});

		// 加载页面
		var f = GetRequest().f;
		if (f) {
			$("#menu-list li.active").removeClass("active")
			$('#' + f).addClass("active");
			$('#iframe').attr('src', 'function/' + f + '.jsp');
		} else {
			$('#ssdf').addClass("active");
		}
	});
	
	function go(f) {
		var stateObject = {};
		var title = '';
		var newUrl = '?f=' + f;
		history.pushState(stateObject, title, newUrl);
		$('#iframe').attr('src', 'function/' + f + '.jsp');
	}

	function iFrameHeight() {
		var ifm = document.getElementById("iframe");
		var subWeb = document.frames ? document.frames["iframe"].document
				: ifm.contentDocument;
		if (ifm != null && subWeb != null) {
			ifm.height = subWeb.body.scrollHeight;
			//ifm.width = subWeb.body.scrollWidth;
		}
	}
</script>
</html>
